//
//  Student.m
//  OC_02实例变量可见度_方法
//
//  Created by wyx on 16/2/25.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "Student.h"

@implementation Student
#pragma mark - 重写init 方法
-(instancetype)init {
    self = [super init];
    if (self) {
        _classroomName = @"DLS160101";
    }
    return self;
}
#pragma mark - 重写父类方法
/**
 * 重写父类方法时父类方法不用再. h文件声明,直接在. m 文件实现
 */
- (void)sayHi{
    [super sayHi];//super 是编译器指令,指调用父类的方法,[super sayHi]是当期对象调用父类的方法,而不是父类对象调用 sayHI 方法
    NSLog(@"grade:%f, classroomNumber:%@",_grade,_classroomName);
}
#pragma mark - setter&&getter
- (void)setGrade:(float)grade{
    _grade = grade;
}
- (float)grade{
    return _grade;
}
- (void)setclassroomName:(NSString *)classroomName{
    _classroomName = classroomName;
}
- (NSString *)className{
    return _classroomName;
}
@end
